<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>for 循环</title>
</head>
<body>
<div id="change" class="change">

</div>
<script>
    let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
    for (let i = 0; i < arr.length; i++) {
        console.log(arr[i]);
    }

    let str = "Hello, World!"
    for (let strElement of str) {
        console.log(strElement);
    }

    let obj = {
        name:'kevin',
        age:18,
        gender:"M"
    }

    for (let objKey in obj) {
        console.log(objKey);
        console.log(obj[objKey]);
    }

    arr.forEach(function (item) {
        console.log(item);
    })

</script>
</body>
</html>